<% /**
	* workoutsAddExercise.jsp
	* 
	* Contains the selection for input of Exercises for the inclusion into a workout object.
	*
	* The sixth page of a sequence of forms requisitioning the user for the information about their workout.
	* The complete sequence is:
	* workoutsCalendar.jsp -- Gets date
	* workouts.jsp -- Gets information common between workout types: userID, prescribed, and type
	* workoutsCreateWorkout.jsp -- redirect dummy page, creates the actual workout object and puts in the fields 
	* 	we've already gotten from the user
	* workoutsAMRAP.jsp/workoutsTimed.jsp/workoutsTabata.jsp -- Gets the type-specific workout information
	* workoutsCreateWorkoutTyped.jsp -- redirect dummy page, adds the typed information to our Workout object
	* workoutsAddExercise.jsp -- Allows the user to select individual exercises and append them to the list in our
		exercise.
	* workoutsCreateExercise.jsp -- redirect dummy page, adds the exercise to our Workout object
	* workoutsSubmit.jsp -- final page, submits the fully created workout to the database
	*
	* @author Chris Avery
	*/
%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@page import="b1w1nn1ng.crossf1t.db.*"%>
    <%@page import="b1w1nn1ng.crossf1t.gui.*"%>
    <%@page import="b1w1nn1ng.crossf1t.business.*"%>
    <%@page import="java.util.*"%>
    
    <% //this is a convienience variable: If it is true, then we have sufficient information to show a graph
    boolean ready = false; %>
	<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
	<html>
	<%  
	User user = (User) session.getAttribute("user");
	session.setAttribute("user", user);

	Workout wo = (Workout) session.getAttribute("curWorkout");
	session.setAttribute("curWorkout", wo);

	%>
	<head>
		<title> Workouts </title>
		<link rel="stylesheet" type="text/css" href="/crossfit/css/general.css" />
		<link rel="stylesheet" type="text/css" href="/crossfit/css/displayWorkout.css" />
	</head>
	<body>
	<div id="container">	
	<!-- This page deliberately contains no navbar: The back button ruins the series of forms -->
		<h1> Add Workout </h1> <hr />
		
		Your exercise has been recorded! The details of this exercise are below:<br /><br />
		<div id="alignleft">
		<%= wo.toHTML() %>
		</div>
		<% wo.writeToDatabase(); %>
		Congratulations!<br />
		<input type="button" value="Return" onclick="window.location='home.jsp'" />
	</div>
	</body>
</html>


